package net.feixue.engine.atomjob;

/**
 * Created by zxxiao on 14/12/31.
 */
public abstract class EngineTask implements Runnable {

    private EngineTaskNotify taskNotify;

    private long id;

    public EngineTask(long id) {
        this.id = id;
    }

    public long getId() {
        return id;
    }

    protected void setTaskNotify(EngineTaskNotify taskNotify) {
        this.taskNotify = taskNotify;
    }

    @Override
    public void run() {
        doJob();
        taskNotify.doNotify(id);
    }

    public abstract void doJob();
}
